From b8c7a4c475fbfb054395fb5cc61e3a677160b544 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 28 Sep 2015 13:52:34 -0700 Subject: [PATCH] Don't fail if dylib outputs aren't supported Currently it's not possible to inform Cargo about target-specific crate types, so generating a hard error whenever a dylib is seen for a target that can't produce dylibs is a little heavy. This commit disables management of the output dylib (which won't actually exists) and relies on the compiler to print a warning in the case of a dylib output on a non-dylib target. --- src/cargo/ops/cargo_rustc/context.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cargo/ops/cargo_rustc/context.rs b/src/cargo/ops/cargo_rustc/context.rs index 93ef0357c..1ba892835 100644 --- a/src/cargo/ops/cargo_rustc/context.rs +++ b/src/cargo/ops/cargo_rustc/context.rs @@ -324,8 +324,9 @@ impl<'a, 'cfg> Context<'a, 'cfg> { for lib in libs.iter() { match *lib { LibKind::Dylib => { - let (prefix, suffix) = try!(self.dylib(kind)); - ret.push(format!("{}{}{}", prefix, stem, suffix)); + if let Ok((prefix, suffix)) = self.dylib(kind) { + ret.push(format!("{}{}{}", prefix, stem, suffix)); + } } LibKind::Lib | LibKind::Rlib => ret.push(format!("lib{}.rlib", stem)), -- 2.30.2